package com.wondersgroup.fjzlpt.console.controller.view.user;

import com.alibaba.fastjson.JSONObject;
import com.quick.framework.boot.web.wapper.QuickPrincipal;
import com.wondersgroup.fjzlpt.console.constant.SystemConstant;
import com.wondersgroup.fjzlpt.console.service.inter.user.UserService;
import com.wondersgroup.fjzlpt.console.utils.ControllerCommonUtils;
import org.apache.commons.lang.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

import javax.servlet.http.HttpServletRequest;
import java.util.Map;

/**
 * 用户管理
 * Created by lion on 2017/5/25.
 */
@Controller
@RequestMapping("/user")
public class UserController {

    @Autowired
    private UserService userService;

    @RequestMapping("/index.html")
    public String index(HttpServletRequest request) {
        JSONObject requestData = ControllerCommonUtils.getRequestData(request);
        request.setAttribute("requestData", requestData);
        return "user/index";
    }

    @RequestMapping("/manager.html")
    public String manager(HttpServletRequest request) {
        String WSJGLBDM = request.getParameter("WSJGLBDM");
        //QuickPrincipal principal = (QuickPrincipal) request.getUserPrincipal();
        /*当前用户的机构ID*/
        //String PTJGID = principal.getUserInfo().getString("PTJGID");
        //Map map = ControllerCommonUtils.getUserQqueryPower(request);
        request.setAttribute("requestData", userService.queryManagerInitData(WSJGLBDM));
        return "user/manager";
    }

}
